package com.team9.fitness.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Service;

/**
 * 系统初始化服务
 * 负责在应用启动时初始化ZRDDS等组件
 */
@Slf4j
@Service
public class SystemInitializationService implements CommandLineRunner {

    @Autowired
    private ZRDDSSendService zrddsSendService;

    @Override
    public void run(String... args) throws Exception {
        try {
            // 初始化ZRDDS发送服务
            zrddsSendService.initialize();
            log.info("ZRDDS发送服务初始化成功");
        } catch (Exception e) {
            log.error("fitness-send系统初始化失败", e);
            throw e;
        }
    }
}
